﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WinFormClient.ServiceReference;

namespace WinFormClient
{
    public partial class Form1 : Form
    {
        public Client client;
        public Form1(Client c)
        {
            InitializeComponent();
            this.client = c;
            this.Text = LocalStorage.GetUserInfo().UserName;
        }

        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            client.Exit();
            Application.Exit();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            UserInfo info = new UserInfo();
            info.UserName = "haha";
            LocalStorage.SaveUserInfo(info);
            LocalStorage.SaveAll();
        }

        private void treeView1_Click(object sender, EventArgs e)
        {
            
        }

        private void treeView1_MouseClick(object sender, MouseEventArgs e)
        {
        }

        private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            //if (e.Node.Text == "Group1")
            //{
            //    tabControl1.TabPages.Add("Group1");
            //}
            tabControl1.TabPages.Add(e.Node.Text);
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Form2 chatform = new Form2();
            chatform.Show();
        }


    }
}
